const http = require("http")
const https = require("https")

const server = http.createServer((req, res) => {
    console.log(`${req.method}`)
    res.writeHead(200, { "Content-Type": "text/html" })
    res.end("<h1>Hello World!</h1>")
})

server.listen(8000)
console.log("http://127.0.0.1:8000")

const request = http.request("http://www.baidu.com", res => {
    console.log(res.statusCode)
})

request.end()



https.get({ hostname: "www.baidu.com", protocol: "https:", port: 443, method: "GET" }, res => {
    console.log(res.headers)
})


